/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.model;

import br.ufmg.dees.insane.drivers.Driver;
import br.ufmg.dees.insane.drivers.EquilibriumPath;
import br.ufmg.dees.insane.drivers.IteractiveStrategy;
import br.ufmg.dees.insane.drivers.LoadControl;
import br.ufmg.dees.insane.drivers.Solution;
import br.ufmg.dees.insane.drivers.Step;
import br.ufmg.dees.insane.drivers.StructuralMech;
import br.ufmg.dees.insane.model.disc.analysismodel.PlaneFrame;
import br.ufmg.dees.insane.model.disc.fem.FemModel;
import br.ufmg.dees.insane.model.geo.GeometricModel;
import br.ufmg.dees.insane.prep.MappingModel;

/**
 * @author Fonseca, Flavio & Pitangueira, Roque
 * @see     gui.Interface
 * @see     gui.DrawingArea
 * @since   January 2004
 */
public class Model implements java.io.Serializable {
	
    /**
	 * Comment for <code>serialVersionUID</code>
	 */
	private static final long serialVersionUID = 1L;
	private GeometricModel geometricModel = new GeometricModel();
    private ModelState state = new ModelState();
	private MappingModel mappingModel = new MappingModel();
    private FemModel discreteModel;
	private Driver driver;
	private Solution solution;
	private Step step;
	private IteractiveStrategy[] is = new IteractiveStrategy[1];
	
//*****************************************************************************
	
    /** Constructor method */
    public Model() {
        driver = new StructuralMech();
    	discreteModel = new FemModel();
    	driver.setFemModel(discreteModel);
		//step = new StandardNewtonRapson(driver, 1, 0, StandardNewtonRapson.FORCE);
		is[0] = new LoadControl(1.0);
		solution = new EquilibriumPath(1, step, is, 1.0, 1.0, 1);
//		processor.setSolution(new EquilibriumPath());
		driver.getFemModel().setGlobalAnalysisModel(new PlaneFrame());
		driver.getFemModel().add(driver.getFemModel().getGlobalAnalysisModel());
    }
	
//*****************************************************************************
	
    public GeometricModel getGModel() {
        return geometricModel;
    }
    
//*****************************************************************************
	
    public void setGModel(GeometricModel geo) {
        geometricModel = geo;
    }
	
//*****************************************************************************
	
    public ModelState getState() {
		return state;
    }
    
//*****************************************************************************
	
	public void setState(ModelState ste) {
        state = ste;
    }
	
//*****************************************************************************
    
    public FemModel getDiscreteModel() {
        return discreteModel;
    }
    
//*****************************************************************************
	
    public void setDiscreteModel(FemModel disc) {
        discreteModel = disc;
    }
	
//*****************************************************************************
	
	public MappingModel getMModel() {
        return mappingModel;
    }
	
//*****************************************************************************
	
    public void setMModel(MappingModel map) {
        mappingModel = map;
    }
	
    public Solution getSolution() {
        return solution;
    }
    
    public void setSolution(Solution s) {
        solution = s;
    }
    
    public Driver getDriver() {
        return driver;
    }
    public void setDriver(Driver dv) {
        this.driver = dv;
    }
    
//*****************************************************************************
}
